// https://developers.weixin.qq.com/miniprogram/dev/component/swiper.html
Page({
  onShareAppMessage() {
    return {
      title: 'swiper',
      path: 'page/swiper/swiper'
    }
  },

  data: {
    // images字段: 存储轮播图中的图片id与图片路径
    images: [
      {id:1, src:'/static/images/Car.png'},
      {id:2, src:'/static/images/Driving.png'},
      {id:3, src:'/static/images/Police chase.png'},
    ],
    indicatorDots: true,
    vertical: false,
    autoplay: false,
    interval: 2000,
    duration: 500,
    circular: false
  },

  changeIndicatorDots() {
    this.setData({
      indicatorDots: !this.data.indicatorDots
    })
  },

  changeAutoplay() {
    this.setData({
      autoplay: !this.data.autoplay
    })
  },

  changeCircular() {
    this.setData({
      circular: !this.data.circular
    })
  },

  intervalChange(e) {
    this.setData({
      interval: e.detail.value
    })
  },

  durationChange(e) {
    this.setData({
      duration: e.detail.value
    })
  }
})